package edu.nuc.event.service;

import edu.nuc.event.dao.ComMapper;
import edu.nuc.event.pojo.Competition;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ComService {

    @Autowired
    private ComMapper comMapper;


    public List<Competition> findAllComs() {
        List<Competition> coms = comMapper.findAllComs();
        //System.out.println(coms);
        return coms;
    }

    public int allComsaccount() {
        int comcount = comMapper.allComsaccount();
        return comcount;
    }

    public Competition selectComByid(int id) {
        Competition com = comMapper.selectComByid(id);
        return com;
    }

    public int delcomp(int comid) {
        int i = comMapper.delcomp(comid);
        return i;
    }

    public int addcomp(Competition competition) {
        int i = comMapper.addcomp(competition);
        return i;
    }

    public int updatecomp(Competition competition) {
        int i = comMapper.updatecomp(competition);
        return i;
    }
}
